import { srvHttp } from '../../api/srvHttp'

//查询所有分类消息
export function getClassAll() {
    return srvHttp({
        url: '/api/goodsClass/selectAll',
        method: 'GET'
    })
}
//查询一级二级分类信息
export function getClassTwo() {
    return srvHttp({
        url: '/api/goodsClass/selectTwo',
        method: 'GET'
    })
}
//添加
export function insertGoodsClass(data) {
    return srvHttp({
        url: '/api/goodsClass/add',
        method: 'POST',
        data: data
    })
}
//修改
export function updateGoodsClass(data) {
    return srvHttp({
        url: '/api/goodsClass/update',
        method: 'POST',
        data: data
    })
}
//删除
export function deleteGoodsClassById(id) {
    return srvHttp({
        url: `/api/goodsClass/delete?id=${id}`,
        method: 'GET',
    })
}
//根据分类级别显示数据
export function getGoodsClassByLevel(level) {
    return srvHttp({
        url: `/api/goodsClass/selectByLevel?level=${level}`,
        method: 'GET',
    })
}